package com.example.demo.controller;

import com.example.demo.domain.Teacher;
import com.example.demo.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/tea")
public class TeacherController {

    @Autowired
    private TeacherService service;

    @RequestMapping("/getAll")
    public List<Teacher> getAll(){
        System.out.println("进入方法--");
        List<Teacher> all = service.getAll();

        return all;
    }
}
